use std::usize;

pub fn dp_rec_mc(amount: u32) -> u32 {
    let amount = amount as usize;
    let coins = vec![1, 2, 5, 10, 20, 30, 50, 100];
    let mut dp = vec![vec![usize::MAX; coins.len()]; amount + 1];
    for i in 0..=amount {
        dp[i][0] = i;
    }
    for i in 0..coins.len() {
        dp[0][i] = 0;
    }
    for i in 1..=amount {
        for j in 1..coins.len() {
            dp[i][j] = dp[i][j - 1];
            let coin_value = coins[j];
            if i >= coin_value {
                dp[i][j] = dp[i][j].min(dp[i - coin_value][j - 1] + 1);
            }
        }
    }

    dp[amount][7] as u32
}
